<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class ShopDoaddRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'sname'=>'required|unique:shops,sname',
            'surl'=>'required',
            'spic'=>'required'
        ];
    }
    /**
     * 自定义错误消息
     * @return array
    */
    public function messages()
    {
        return [
            'sname.required'=>'请填写商店名',
            'sname.unique'=>'此商店名已存在',
            'surl.required'=>'请填写商店地址',
            'spic.required'=>'请上传商店图片'
        ];
    }
}
